<template>
  <teleport to="#back">
    <div class="d-flex justify-content-center align-item-center h-100 lading-container"
      :style="{ backgroundColor: background || '' }">
      <div class="loading-content" style="margin-top: 200px;">
        <div class="spinner-grow text-primary" role="status">
          <span class="visually-hidden">Loading...</span>
        </div>
        <p v-if="text" class="text-primary">{{ text }}</p>
      </div>
    </div>
  </teleport>
</template>
<script setup lang="ts">
import useDOMCreate from '../hooks/useDOMCreate';
interface Props {
  text: string,
  background: string
}
defineProps<Props>()
useDOMCreate('back')

</script >

<style>
.lading-container {
  background: rgba(255, 255, 255, .3);
  z-index: 100;
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;

}

.lading-container {
  text-align: center;
}
</style>